//
//  SuperMarketViewController.m
//  LoveFreshBeen
//
//  Created by 辛路琦 on 16/6/11.
//  Copyright © 2016年 xinluqi. All rights reserved.
//

#import "SuperMarketViewController.h"
#import "UIBarButtonItem+Item.h"
#import "HomeNavigationItem.h"

@interface SuperMarketViewController ()

@end

@implementation SuperMarketViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

/**
 *  自定义导航栏按钮
 */
- (void)setUpNavItem
{
    // 设置左边的按钮
    HomeNavigationItem *button = [HomeNavigationItem buttonWithType:UIButtonTypeCustom];
    
    [button setImage:[UIImage imageNamed:@"icon_black_scancode"] forState:UIControlStateNormal];
    
    [button setTitle:@"扫一扫" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(QRCodeBtnClick) forControlEvents:UIControlEventTouchUpInside];
    button.frame = CGRectMake(0, 0, 30, 40);
    button.titleLabel.font = [UIFont boldSystemFontOfSize:8];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    // 设置右边的按钮
    HomeNavigationItem *SearchBtn = [HomeNavigationItem buttonWithType:UIButtonTypeCustom];
    
    [SearchBtn setImage:[UIImage imageNamed:@"icon_search"] forState:UIControlStateNormal];
    
    [SearchBtn setTitle:@"搜索" forState:UIControlStateNormal];
    [SearchBtn addTarget:self action:@selector(QRCodeBtnClick) forControlEvents:UIControlEventTouchUpInside];
    SearchBtn.frame = CGRectMake(0, 0, 30, 40);
    SearchBtn.titleLabel.font = [UIFont boldSystemFontOfSize:8];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:SearchBtn];
    
    
    // 设置标题
    UIImageView *titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"jingxuan.png"]];
    self.navigationItem.titleView = titleView;
    
}

- (void)QRCodeBtnClick
{
    NSLog(@"%s",__func__)
}

- (void)SearchBtnClick
{
    NSLog(@"%s",__func__)
}


@end
